package com.example.demo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.exception.BusinessException;
import com.example.demo.exception.ParamException;
import com.example.demo.exception.SystemException;

@RestController
public class IndexController {
	
	@RequestMapping("/")
	String home() {
		return "Hello World!";
	}
	@IgnoreResponseAdvice
	@RequestMapping("/hi")
	String hi() {
		return "Hello World!";
	}

	@RequestMapping("/param")
	String param() throws Exception {
		throw new ParamException("参数错误");
	}

	@RequestMapping("/business")
	String business() throws Exception {
		throw new BusinessException("业务错误");
	}
	@RequestMapping("/system")
	String system() throws Exception {
		throw new SystemException("系统错误");
	}
}
